<template>
    <!-- 标题 -->
    <div>
        <div>
            <van-nav-bar title="全部" />
        </div>
        <!-- 轮播图 -->
        <van-tabs v-model:active="active">
            <van-tab title="全部">
                <van-swipe :autoplay="3000" lazy-render>
                    <van-swipe-item v-for="image in list" :key="image">
                        <img :src="image.image_src" style="width: 100%;" />
                    </van-swipe-item>
                </van-swipe>
                <!-- 页面图片排版 -->
                <van-grid :border="false" :column-num="2">
                    <van-grid-item>
                        <van-image src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg" />
                    </van-grid-item>
                    <van-grid-item>
                        <van-image src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg" />
                    </van-grid-item>
                    <van-grid-item>
                        <van-image src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg" />
                    </van-grid-item>
                    <van-grid-item>
                        <van-image src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg" />
                    </van-grid-item>
                    <van-grid-item>
                        <van-image src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg" />
                    </van-grid-item>
                    <van-grid-item>
                        <van-image src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg" />
                    </van-grid-item>
                </van-grid>
            </van-tab>
            <!-- 标签页 -->
            <van-tab title="分类">内容 2</van-tab>
            <van-tab title="购物车">内容 3</van-tab>
            <van-tab title="我的">内容 4</van-tab>
        </van-tabs>
    </div>
</template>

<script setup>
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
];
import { ref } from 'vue';
import { swiperdataApi } from '@/api/api';

let list = ref("")
const getlist = () => {
    swiperdataApi().then(res => {
        list.value = res.data.message
    })
}
getlist()
</script>

<style lang="scss" scoped></style>